#include <iostream>

using namespace std;

int array_once(unsigned long* number_array, unsigned int n);

int main() {
	unsigned int n;
	cin >> n;
	unsigned long* number_array = new unsigned long[n];
	for (unsigned int i = 0; i < n; i++) {
		cin >> *(number_array + i);
	}
	cout << array_once(number_array, n);
	delete[] number_array;
}

int array_once(unsigned long* number_array, unsigned int n) {
	unsigned int i = 0;
	for (; i < n; i += 2) {
		bool once = true;
		for (unsigned int j = i + 1; j < n; j++) {
			if (*(number_array + i) == *(number_array + j)) {
				swap(*(number_array + i + 1), *(number_array + j));
				once = false;
				break;
			}
		}
		if (once) {
			break;
		}
	}
	return *(number_array + i);
}